#ifndef GNSYSTEMDEFINE_H
#define GNSYSTEMDEFINE_H

#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <tchar.h>
#include <wchar.h>
#include <stddef.h>
#include <string>
#include <io.h>
#include <string.h>
#include <sys/stat.h>
#include <Windows.h>

#if defined(WIN32)
	#ifndef GNFORCEINLINE
		#if (_MSC_VER >= 1200)
		#define GNFORCEINLINE __forceinline
		#else
		#define GNFORCEINLINE __inline
		#endif
	#endif
#define  GNNOOP __noop
#elif defined(__GNUC__)
	#ifndef GNFORCEINLINE
		#if
		#define GNFORCEINLINE __inline__ __attribute__((always_inline))
		#else
		#define GNFORCEINLINE __inline
		#endif
	#endif
#define  GNNOOP ((void)0)
#endif // defined(WIN32)

typedef int gint;
typedef unsigned int guint;
typedef long glong;
typedef unsigned long gulong;
typedef short gshort;
typedef unsigned short gushort;
typedef char gchar;
typedef unsigned char guchar;

typedef __int8 gint8;
typedef unsigned __int8 guint8;
typedef __int16 gint16;
typedef unsigned __int16 guint16;
typedef __int32 gint32;
typedef unsigned __int32 guint32;
typedef __int64 gint64;
typedef unsigned __int64 guint64;

typedef size_t gsize;

typedef wchar_t gwchar;

#if defined(GN64)

typedef INT64 gtint;
typedef UINT64 gtuint;
typedef LONG64 gtlong;
typedef ULONG64 gtulong;

#else //  defined(GN64)

typedef INT32 gtint;
typedef UINT32 gtuint;
typedef LONG32 gtlong;
typedef ULONG32 gtulong;

#endif // defined(GN64)

#define GnStrcpy strcpy_s
#define GnStrncpy strncpy_s
char* GnStrtok(char* pcString, const char* pcDelimit, char** ppcContext);

#ifdef GNUNICODE

typedef wchar_t gtchar;
typedef std::wstring gtstring;

#define GnTstrlen wcslen
#define GnTstrcpy wcscpy_s
#define GnTvssprintf vswprintf_s
#define GnTsprintf swprintf_s
#define GnTaccess _waccess
#define GnTfopen _wfopen_s
#define GnTfgets fgetws
#define GnTvfprintf vfwprintf_s
#define GnTfsscanf fwscanf_s
#define GnTsscanf swscanf_s

#else // #ifdef GNUNICODE

typedef char gtchar;
typedef std::string gtstring;

#define GnTstrlen strlen
#define GnTstrcpy strcpy_s
#define GnTsprintf sprintf_s
#define GnTvssprintf vsprintf_s
#define GnTsprintf sprintf_s
#define GnTaccess _access
#define GnTfopen fopen_s
#define GnTfgets fgets
#define GnTvfprintf vfprintf_s
#define GnTfsscanf fscanf_s
#define GnTsscanf  sscanf_s

#endif // #ifdef GNUNICODE



#define GnText _T

typedef HWND GnWindowHandle;
typedef HINSTANCE GnInstance;

#include "GnSystemDefine.inl"
#endif // GNSYSTEMDEFINE_H
